package com.sx.pipeline.event

import java.io.Serializable

/**
 *    author : zhouyouqiang
 *    e-mail : 1638473898@qq.com
 *    date   : 2022-07-22 9:57
 *    desc   :第三方支付结果Event
 *    version: 1.0
 */
data class PayResultEvent(var isSuccess: Boolean = false, var msg: String? = "", var targetPage: Any? = null) :
    Serializable {

    fun boxUp(rawResult: Map<String, String>): PayResultEvent {
        for ((key, value) in rawResult) {
            when (key) {
                "resultStatus" -> isSuccess = value == "9000"
                "result" -> msg = value
            }
        }
        return this
    }
}